<!--#include file="AspCms_ContentFun.asp" -->
<%CheckAdmin("AspCms_ContentList.asp?sortType="&sortType)%>
<!DOCTYPE html>
<html lang="zh-CN" style="min-height: 100%;">
<head>
<title>ContentEdit</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />

<link href="https://cdn.bootcss.com/uikit/3.0.0-beta.22/css/uikit.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/jquery.perfect-scrollbar/0.7.0/css/perfect-scrollbar.min.css" rel="stylesheet">
<link href="../../css/timoo/fancySelect.css" rel="stylesheet">
<link href="../../css/timoo/jquery.datetimepicker.min.css" rel="stylesheet">
<link href="../../css/timoo/timoo.css" rel="stylesheet">

<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="../../ueditor/ueditor.config.js"></script>
<script src="../../ueditor/ueditor.all.min.js"> </script>
<script src="../../ueditor/lang/zh-cn/zh-cn.js"></script>
<script src="https://cdn.bootcss.com/uikit/3.0.0-beta.22/js/uikit.min.js"></script>
<script src="https://cdn.bootcss.com/uikit/3.0.0-beta.22/js/uikit-icons.min.js"></script>
<script src="https://cdn.bootcss.com/jquery.perfect-scrollbar/0.7.0/js/perfect-scrollbar.jquery.min.js"></script>
<script src="../../js/timoo/icheck.min.js"></script>
<script src="../../js/timoo/fancySelect.js"></script>
<script src="../../js/timoo/jquery.datetimepicker.full.min.js"></script>
<script src="../../js/timoo/iColorPicker.js"></script>
<script src="../../js/timoo/timoo.js"></script>
</head>
<body>
<div class="tm-right">
    <div class="main">
        <div class="section setting-company">
            <form name="form" action="?action=add<%="&sortType="&sortType&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&"&id="&contentid&""%>" method="post">
                <div class="layout">
                    <div class="title">添加<%=sortTypeName%></div>
                    <div class="content">
                        <div class="tm-transition radio table-select list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">所属栏目</span>
                            </div>
                            <div class="uk-clearfix input">
                                <li class="uk-clearfix uk-float-left input-select transverse-select">
                                    <%LoadSelect "SortID","Aspcms_Sort","SortName","SortID",sortid,0," and( sortid in(select ParentID from {prefix}Sort where 1=1 and SortType="&sortType&") or SortType="&sortType&")","请选择所属栏目"%>
                                </li>
                            </div>
                        </div>
                        <div class="tm-transition list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">标题</span>
                            </div>
                            <div class="input">
                                <input type="text" maxLength="200" name="Title">
                            </div>
                        </div>
                        <div class="tm-transition color list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">标题颜色</span>
                            </div>
                            <div class="input">
                                <input type="text" id="TitleColor" style="width:80px;" class="iColorPicker" name="TitleColor" type="text" value="#333333">
                            </div>
                        </div>
                        <%getSpec(0)%>
                        <% if sortType="2" then%>
                        <div class="tm-transition list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">作者</span>
                            </div>
                            <div class="input">
                                <input type="text" maxLength="200" name="Author">
                            </div>
                        </div>
                        <div class="tm-transition list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">来源</span>
                            </div>
                            <div class="input">
                                <input type="text" maxLength="200" name="ContentSource">
                            </div>
                        </div>
                        <%end if%>
                        <div class="tm-transition editor list hide">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">内容</span>
                                <a href="javascript:void()" onClick="SetEditorPage('Content', '{aspcms:page}')">
                                    插入分页（{aspcms:page}）
                                </a>
                            </div>
                            <div class="uk-clearfix input">
                                <textarea name="Content" id="myEditor"><%=content%></textarea>
                                <script> UE.getEditor('myEditor'); </script>
                            </div>
                        </div>
                        <div class="tm-transition input list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left"><%=sortTypeName%>封面图片</span>
                                <i class="tm-transition icon" uk-icon="icon: info" uk-tooltip="pos: right" title="封面图片，可在前台调用。"></i>
                            </div>
                            <div class="uk-clearfix input">
                                <input type="text" name="indeximage" id="indeximage" value="<%=Indeximage%> ">
                                <input type="hidden" name="ImagePath" id="ImagePath" value="<%=ImagePath%>">
                                <!--<input type="checkbox" name="AutoRemote" value='1'> 自动保存远程图片 -->
                            </div>
                        </div>
                        <!--
                        <div class="tm-transition radio table-select list hide">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">从上传的图片中选择</span>
                            </div>
                            <div class="uk-clearfix input">
                                <li class="uk-clearfix uk-float-left input-select transverse-select">
                                    <select class="tm-select" name="ImageFileList" id="ImageFileList" onChange="indeximage.value=this.value;">
                                        <option value=''>不选择首页推荐图片</option>
                                    </select>
                                    <input type="button" name="selectpic" value="从已上传图片中选择" onClick="SelectPhoto()">
                                </li>
                            </div>
                        </div>
                        -->
                        <div class="tm-transition list have upload picture-upload">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">上传图片</span>
                            </div>
                            <div class="input">
                                <iframe name="image" frameborder="0" width='100%' height="40" scrolling="no" src="../../editor/upload.asp?sortType=<%=sortType%>&stype=image&Tobj=content" allowTransparency="true"></iframe>
                            </div>
                        </div>
                        <div class="tm-transition list picture-list radio">
                            <div class="picture-box">
                                <div id="pw" uk-grid>
                                <%
                                    if not isnul(ImagePath) then 
                                        dim j,images
                                        images=split(ImagePath,"|")
                                        for j=0 to ubound(images)
                                            echo "<div id='img"&j&"' class='uk-width-1-6 image-box' data-image='"&images(j)&"'><div class='box'><a class='uk-cover-container' href=""javascript:SetEditorContents('Content','"&images(j)&"')""><img src="""&images(j)&""" uk-cover></a><div class='uk-clearfix images-control'><div class='uk-float-left images-input'><label for='Images"&j&"' class='uk-clearfix uk-float-left tm-transition'><input id='Images"&j&"' type='radio' value='"&images(j)&"' name='IndexImageradio' onclick=""setIndexImage('"&images(j)&"')"" ><span class='text'>设为封面</span></label></div><div class='uk-float-right del-link'><a href=""javascript:dropThisDiv('img"&j&"','"&images(j)&"')"">删除</a></div></div></div></div>"
                                        next
                                    end if
                                %>
                                </div>
                            </div>
                            <script>
                                function SetEditorContents(EditorName, ContentStr){
                                    UE.getEditor('myEditor').execCommand('insertHtml', "<img src="+"'"+ContentStr+"'"+"/>")	
                                }
                                function SetEditorPage(EditorName, ContentStr) {
                                    UE.getEditor('myEditor').execCommand('insertHtml', ContentStr)		
                                }
                            </script>
                        </div>
                        <% if sortType="8" then%>
                        <div class="tm-transition radio list hide">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">观看权限</span>
                                <i class="tm-transition icon" uk-icon="icon: info" uk-tooltip="pos: right" title="只有满足权限的用户才能观看视频。（ 隶属：权限值≥该用户组可查看；专属：权限值＝该用户组可查看）"></i>
                            </div>
                            <div class="uk-clearfix input">
                                <li class="uk-clearfix uk-float-left input-select transverse-select">
                                    <%=userGroupSelect("VideoGroupID", GroupID, 0)%>
                                </li>
                            </div>
                        </div>
                        <div class="tm-transition input list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">视频地址</span>
                            </div>
                            <div class="uk-clearfix input">
                                <input type="text" name="ContentSource" id="videoPath">
                            </div>
                        </div>
                        <div class="tm-transition list have upload picture-upload">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">上传视频</span>
                            </div>
                            <div class="input">
                                <iframe name="image" frameborder="0" width='100%' height="40" scrolling="no" src="../../editor/upload.asp?sortType=<%=sortType%>&stype=video&Tobj=content" allowTransparency="true"></iframe>
                            </div>
                        </div>
                        <%end if%>
                        <% if sortType="4" then%>
                        <div class="tm-transition radio list hide">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">下载权限</span>
                                <i class="tm-transition icon" uk-icon="icon: info" uk-tooltip="pos: right" title="只有满足权限的用户才能下载文件。（ 隶属：权限值≥该用户组可查看；专属：权限值＝该用户组可查看）"></i>
                            </div>
                            <div class="uk-clearfix input">
                                <li class="uk-clearfix uk-float-left input-select transverse-select">
                                    <%=userGroupSelect("DownGroupID", DownGroupID, 0)%>
                                </li>
                            </div>
                        </div>
                        <div class="tm-transition input list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">文件地址</span>
                            </div>
                            <div class="uk-clearfix input">
                                <input type="text" maxlength="255" id="DownURL" name="DownURL">
                            </div>
                        </div>
                        <div class="tm-transition list have upload picture-upload">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">上传文件</span>
                            </div>
                            <div class="input">
                                <iframe name="image" frameborder="0" width='100%' height="40" scrolling="no"src="../../editor/upload.asp?sortType=<%=sortType%>&stype=file&Tobj=DownURL" allowTransparency="true"></iframe>
                            </div>
                        </div>
                        <%end if%>
                        <div class="tm-transition radio list hide">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">浏览权限</span>
                                <i class="tm-transition icon" uk-icon="icon: info" uk-tooltip="pos: right" title="该内容的访问权限的设定。（ 隶属：权限值≥该用户组可查看；专属：权限值＝该用户组可查看）"></i>
                            </div>
                            <div class="uk-clearfix input">
                                <li class="uk-clearfix uk-float-left input-select transverse-select">
                                    <%=userGroupSelect("GroupID", 0, 0)%>
                                </li>
                                <label for="Power-Subjection" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">隶属</span>
                                    <input id="Power-Subjection" type="radio" name="Exclusive" value=">=" checked="checked">
                                </label>
                                <label for="Power-Exclusive" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">专属</span>
                                    <input id="Power-Exclusive" type="radio" name="Exclusive" value="="> 
                                </label>
                            </div>
                        </div>
                        <div class="tm-transition radio table-select list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">内容星级</span>
                                <i class="tm-transition icon" uk-icon="icon: info" uk-tooltip="pos: right" title="内容的星级，使用时请在模板中调用相关星级的分类标签内容。"></i>
                            </div>
                            <div class="uk-clearfix input input-select">
                                <select class="tm-select" name="star">
                                    <option value="1">★</option>
                                    <option value="2">★★</option>
                                    <option value="3">★★★</option>
                                    <option value="4">★★★★</option>
                                    <option value="5">★★★★★</option>
                                    <option value="6">★★★★★★</option>
                                    <option value="7">★★★★★★★</option>
                                </select>
                            </div>
                        </div>
                        <div class="tm-transition input list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">浏览次数</span>
                            </div>
                            <div class="uk-clearfix input">
                                <input type="text" maxlength="6" value="0" name="Visits">
                            </div>
                        </div>
                        <div class="tm-transition list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">发布时间</span>
                            </div>
                            <div class="input">
                                <input id="Add-Time" type="text" value="<%=FormatDate(now(), "yy-m-d h:mi:s")%>" name="AddTime">
                            </div>
                        </div>
                        <div class="tm-transition checkbox list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">是否启用定时发布</span>
                            </div>
                            <div class="uk-clearfix input">
                                <label for="Time-Status" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">启用</span>
                                    <input id="Time-Status" type="checkbox" name="TimeStatus" value="1">
                                </label>
                            </div>
                        </div>
                        <div class="tm-transition list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">定时发布时间</span>
                            </div>
                            <div class="input">
                                <input id="Timeing" type="text" value="<%=FormatDate(now(), "yy-m-d h:mi:s")%>" name="Timeing">
                            </div>
                        </div>
                        <div class="tm-transition input list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">排序</span>
                                <i class="tm-transition icon" uk-icon="icon: info" uk-tooltip="pos: right" title="该排序需要模板中的排序方法使用order才会有效。"></i>
                            </div>
                            <div class="uk-clearfix input">
                                <input type="text" maxlength="6" value="0" name="ContentOrder">
                            </div>
                        </div>
                        <div class="tm-transition checkbox list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">其它选项</span>
                            </div>
                            <div class="uk-clearfix input">
                                <label for="Is-Top" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">置顶</span>
                                    <input id="Is-Top" type="checkbox" name="IsTop" value="1">
                                </label>
                                <label for="Is-Recommend" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">推荐</span>
                                    <input id="Is-Recommend" type="checkbox" name="IsRecommend" value="1">
                                </label>
                                <label for="Is-Featured" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">特别推荐</span>
                                    <input id="Is-Featured" type="checkbox" name="IsFeatured" value="1" <% if IsFeatured then echo"checked='checked'"%>>
                                </label>
                                <label for="Is-ImageNews" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">图片新闻</span>
                                    <input id="Is-ImageNews" type="checkbox" name="IsImageNews" value="1">
                                </label>
                                <label for="Is-NoComment" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">禁止发表评论</span>
                                    <input id="Is-NoComment" type="checkbox" name="IsNoComment" value="1">
                                </label>
                                <label for="Is-Top" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">发布</span>
                                    <input id="Is-Top" type="checkbox" checked="checked" name="ContentStatus" value="1">
                                </label>
                            </div>
                        </div>
                        <div class="tm-transition input list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">自定义文件名</span>
                                <i class="tm-transition icon" uk-icon="icon: info" uk-tooltip="pos: right" title="当前文章的生成静态文件的命名规则。如果留空则以分类的统一命名规则为准，文件后缀名为“<%=FileExt%>”。"></i>
                            </div>
                            <div class="uk-clearfix input">
                                <input type="text" maxlength="200" name="PageFileName">
                                <input type="hidden" name="IsGenerated" value="1"/>
                            </div>
                        </div>
                        <div class="tm-transition input list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">TAG标签</span>
                                <i class="tm-transition icon" uk-icon="icon: info" uk-tooltip="pos: right" title="多个标签请用英文逗号隔开。"></i>
                            </div>
                            <div class="uk-clearfix input">
                                <input type="text" maxlength="200" name="ContentTag">
                            </div>
                        </div>
                        <div class="tm-transition input list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">SEO页面关键词</span>
                            </div>
                            <div class="uk-clearfix input">
                                <input type="text" maxlength="200" name="PageKeywords" value="<%=PageKeywords%>">
                            </div>
                        </div>
                        <div class="tm-transition textarea list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">SEO页面描述</span>
                            </div>
                            <div class="input">
                                <textarea name="PageDesc"><%=PageDesc%></textarea>
                            </div>
                        </div>
                        <div class="tm-transition checkbox list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">是否启用链接跳转</span>
                            </div>
                            <div class="uk-clearfix input">
                                <label for="Is-OutLink" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">启用</span>
                                    <input id="Is-OutLink" type="checkbox" name="IsOutLink" value="1">
                                </label>
                            </div>
                        </div>
                        <div class="tm-transition input list">
                            <div class="uk-clearfix tm-transition subject">
                                <span class="uk-float-left">链接跳转地址</span>
                            </div>
                            <div class="uk-clearfix input">
                                <input type="text" maxlength="200" name="OutLink">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layout">
                    <div class="title">保存更改</div>
                    <div class="content">
                        <div class="uk-clearfix tm-transition list submit">
                            <input type="hidden" maxlength="200" name="sortType" value="<%=sortType%>"> 
                            <div class="uk-float-left input">
                                <input type="submit" value="添加">
                            </div>
                            <div class="uk-float-left input">
                                <input type="button" value="返回" onClick="history.go(-1)"> 
                            </div>
                            <div class="uk-float-left input">
                                <input type="button" value="刷新" onClick="location.href='<%=getPageName()%>?sortType=<%=sortType%>'">
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    
function tm_images_select(){
    
    var IndexImage = jQuery('#indeximage').val();
    
    
    jQuery('.image-box').each(function(){
        
        var BoxImage = jQuery(this).data('image') + ' ';
        
        if( IndexImage === BoxImage ){
            
            jQuery(this).find('input[type=radio]').prop('checked',true);
            
        }
        
    })
    
}
    
tm_images_select();
    
function dropThisDiv(t,p){
    
    document.getElementById(t).style.display='none'
    var str =document.getElementById("ImagePath").value;
    var arr = str.split("|");
    var nstr="";
    
    for (var i=0; i<arr.length; i++){
        
        if(arr[i]!=p){
            
            if (nstr!=""){
                
                nstr=nstr+"|";
            
            }	
            
            nstr=nstr+arr[i]
        
        }
    
    }
    
    document.getElementById("ImagePath").value=nstr;
    
    doChange(document.getElementById("ImagePath"),document.getElementById("ImageFileList"))

}

function setIndexImage(t){
    
    document.getElementById("indeximage").value=t
    
    doChange(document.getElementById("ImagePath"),document.getElementById("ImageFileList"))

}

function doChange(objText, objDrop){
    
    if (!objDrop) return;
    
    var str = objText.value;
    var arr = str.split("|");
    var nIndex = objDrop.selectedIndex;
    
    objDrop.length=1;
    
    for (var i=0; i<arr.length; i++){
        
        objDrop.options[objDrop.length] = new Option(arr[i], arr[i]);
    
    }
    
    objDrop.selectedIndex = nIndex;

}

doChange(document.getElementById("ImagePath"),document.getElementById("ImageFileList"))
  
jQuery.datetimepicker.setLocale('zh');
    
jQuery('#Add-Time, #Timeing').datetimepicker({
        
    format: 'Y-m-d H:i:s',
    timepicker: true,
    step: 1,
        
});
</script>
</body>
</html>